#include "HostileEntity.hpp"
#include "../MFSMachine.hpp"

using namespace std;

HostileEntity::HostileEntity(string modelName, string textureName) : Entity3D(modelName, textureName)
{
	m_hostileEntityType = UNDEFINED_HOSTILE;
	m_eType = DYNAMIC;
	m_pMFSMachine     = new MFSMachine<HostileEntity, HostileEntityStateName>(this);
	m_pMFSMachine->setCurrentState(new HostileIdle());
	m_pMFSMachine->setListenerState(new HostileListen());
}

HostileEntity::~HostileEntity()
{
	delete m_pMFSMachine;
	m_pMFSMachine = NULL;
}

MFSMachine<HostileEntity, HostileEntityStateName>* HostileEntity::getStateMachine()
{
	return m_pMFSMachine;
}

void HostileEntity::update(clock_t tick)
{
}

void HostileEntity::handleMessage(MMessage *pMsg)
{
	getStateMachine()->handleMessage(pMsg);
}

//EOF
